﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MvcControlsToolkit
{
    public class PointLabels: BaseObject
    {
        public bool Show
        {
            get
            {
                if (Attributes.ContainsKey("show"))
                    return Boolean.Parse(GetString("show"));
                else
                    return true;
            }

            set
            {
                Attributes["show"] = value.ToString().ToLower();
            }
        }

        public Position Position
        {
            get
            {
                switch (GetString("location"))
                {
                    case "s": return Position.Bottom;
                    case "w": return Position.Left;
                    case "n": return Position.Top;
                    case "e": return Position.Right;
                    default: return Position.Right;
                }
            }
            set
            {
                switch (value)
                {
                    case Position.Bottom: SetString("location", "s"); break;
                    case Position.Left: SetString("location", "w"); break;
                    case Position.Top: SetString("location", "n"); break;
                    case Position.Right: SetString("location", "e"); break;
                }
            }
        }

        public int yPadding
        {
            get
            {
                if (Attributes.ContainsKey("ypadding"))
                    return int.Parse(Attributes["ypadding"]);
                else return 0;
            }
            set { Attributes["ypadding"] = value.ToString().ToLower(); }
        }
    }
}
